/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('pcdn', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddConsumerRequest {
  bandwidthRequirement?: string(name='BandwidthRequirement'),
  businessType?: string(name='BusinessType'),
  ca?: string(name='Ca'),
  company?: string(name='Company'),
  email?: string(name='Email'),
  mobile?: string(name='Mobile'),
  operator?: string(name='Operator'),
  requirement?: string(name='Requirement'),
  securityToken?: string(name='SecurityToken'),
  site?: string(name='Site'),
  version?: string(name='Version'),
}

model AddConsumerResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model AddConsumerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddConsumerResponseBody(name='body'),
}

async function addConsumerWithOptions(request: AddConsumerRequest, runtime: Util.RuntimeOptions): AddConsumerResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddConsumer',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addConsumer(request: AddConsumerRequest): AddConsumerResponse {
  var runtime = new Util.RuntimeOptions{};
  return addConsumerWithOptions(request, runtime);
}

model AddDomainRequest {
  businessType?: string(name='BusinessType'),
  demoUrls?: string(name='DemoUrls'),
  domain?: string(name='Domain'),
  liveFormat?: string(name='LiveFormat'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  sliceDomain?: string(name='SliceDomain'),
  version?: string(name='Version'),
}

model AddDomainResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model AddDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddDomainResponseBody(name='body'),
}

async function addDomainWithOptions(request: AddDomainRequest, runtime: Util.RuntimeOptions): AddDomainResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddDomain',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addDomain(request: AddDomainRequest): AddDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDomainWithOptions(request, runtime);
}

model AddPcdnControlRuleRequest {
  appVersion?: string(name='AppVersion'),
  businessType?: string(name='BusinessType'),
  ispName?: string(name='IspName'),
  market?: string(name='Market'),
  name?: string(name='Name'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model AddPcdnControlRuleResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model AddPcdnControlRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddPcdnControlRuleResponseBody(name='body'),
}

async function addPcdnControlRuleWithOptions(request: AddPcdnControlRuleRequest, runtime: Util.RuntimeOptions): AddPcdnControlRuleResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddPcdnControlRule',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addPcdnControlRule(request: AddPcdnControlRuleRequest): AddPcdnControlRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addPcdnControlRuleWithOptions(request, runtime);
}

model DeleteDomainRequest {
  domain?: string(name='Domain'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model DeleteDomainResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model DeleteDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDomainResponseBody(name='body'),
}

async function deleteDomainWithOptions(request: DeleteDomainRequest, runtime: Util.RuntimeOptions): DeleteDomainResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomain',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDomain(request: DeleteDomainRequest): DeleteDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainWithOptions(request, runtime);
}

model DeletePcdnControlRuleRequest {
  resourceId?: string(name='ResourceId'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model DeletePcdnControlRuleResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
}

model DeletePcdnControlRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeletePcdnControlRuleResponseBody(name='body'),
}

async function deletePcdnControlRuleWithOptions(request: DeletePcdnControlRuleRequest, runtime: Util.RuntimeOptions): DeletePcdnControlRuleResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePcdnControlRule',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePcdnControlRule(request: DeletePcdnControlRuleRequest): DeletePcdnControlRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePcdnControlRuleWithOptions(request, runtime);
}

model DisablePcdnControlRuleRequest {
  resourceId?: string(name='ResourceId'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model DisablePcdnControlRuleResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model DisablePcdnControlRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisablePcdnControlRuleResponseBody(name='body'),
}

async function disablePcdnControlRuleWithOptions(request: DisablePcdnControlRuleRequest, runtime: Util.RuntimeOptions): DisablePcdnControlRuleResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisablePcdnControlRule',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disablePcdnControlRule(request: DisablePcdnControlRuleRequest): DisablePcdnControlRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disablePcdnControlRuleWithOptions(request, runtime);
}

model EditPcdnControlRuleRequest {
  appVersion?: string(name='AppVersion'),
  businessType?: string(name='BusinessType'),
  ispName?: string(name='IspName'),
  market?: string(name='Market'),
  name?: string(name='Name'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  resourceId?: string(name='ResourceId'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model EditPcdnControlRuleResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model EditPcdnControlRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EditPcdnControlRuleResponseBody(name='body'),
}

async function editPcdnControlRuleWithOptions(request: EditPcdnControlRuleRequest, runtime: Util.RuntimeOptions): EditPcdnControlRuleResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditPcdnControlRule',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function editPcdnControlRule(request: EditPcdnControlRuleRequest): EditPcdnControlRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return editPcdnControlRuleWithOptions(request, runtime);
}

model EnablePcdnControlRuleRequest {
  resourceId?: string(name='ResourceId'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model EnablePcdnControlRuleResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model EnablePcdnControlRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnablePcdnControlRuleResponseBody(name='body'),
}

async function enablePcdnControlRuleWithOptions(request: EnablePcdnControlRuleRequest, runtime: Util.RuntimeOptions): EnablePcdnControlRuleResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnablePcdnControlRule',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enablePcdnControlRule(request: EnablePcdnControlRuleRequest): EnablePcdnControlRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enablePcdnControlRuleWithOptions(request, runtime);
}

model GetAccessDataRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetAccessDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetAccessDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAccessDataResponseBody(name='body'),
}

async function getAccessDataWithOptions(request: GetAccessDataRequest, runtime: Util.RuntimeOptions): GetAccessDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAccessData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAccessData(request: GetAccessDataRequest): GetAccessDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAccessDataWithOptions(request, runtime);
}

model GetAllAppVersionsRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetAllAppVersionsResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      code?: int32(name='Code'),
      value?: string(name='Value'),
    }
  ](name='UsageData')
  }(name='DataList'),
  requestId?: string(name='RequestId'),
}

model GetAllAppVersionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAllAppVersionsResponseBody(name='body'),
}

async function getAllAppVersionsWithOptions(request: GetAllAppVersionsRequest, runtime: Util.RuntimeOptions): GetAllAppVersionsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAllAppVersions',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAllAppVersions(request: GetAllAppVersionsRequest): GetAllAppVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllAppVersionsWithOptions(request, runtime);
}

model GetAllIspRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetAllIspResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      nameCn?: string(name='NameCn'),
      nameEn?: string(name='NameEn'),
      resourceId?: string(name='ResourceId'),
    }
  ](name='UsageData')
  }(name='DataList'),
  requestId?: string(name='RequestId'),
}

model GetAllIspResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAllIspResponseBody(name='body'),
}

async function getAllIspWithOptions(request: GetAllIspRequest, runtime: Util.RuntimeOptions): GetAllIspResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAllIsp',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAllIsp(request: GetAllIspRequest): GetAllIspResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllIspWithOptions(request, runtime);
}

model GetAllMarketsRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetAllMarketsResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      code?: int32(name='Code'),
      marketCode?: string(name='MarketCode'),
      marketName?: string(name='MarketName'),
    }
  ](name='UsageData')
  }(name='DataList'),
  requestId?: string(name='RequestId'),
}

model GetAllMarketsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAllMarketsResponseBody(name='body'),
}

async function getAllMarketsWithOptions(request: GetAllMarketsRequest, runtime: Util.RuntimeOptions): GetAllMarketsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAllMarkets',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAllMarkets(request: GetAllMarketsRequest): GetAllMarketsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllMarketsWithOptions(request, runtime);
}

model GetAllPlatformTypesRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetAllPlatformTypesResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      code?: int32(name='Code'),
      name?: string(name='Name'),
    }
  ](name='UsageData')
  }(name='DataList'),
  requestId?: string(name='RequestId'),
}

model GetAllPlatformTypesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAllPlatformTypesResponseBody(name='body'),
}

async function getAllPlatformTypesWithOptions(request: GetAllPlatformTypesRequest, runtime: Util.RuntimeOptions): GetAllPlatformTypesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAllPlatformTypes',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAllPlatformTypes(request: GetAllPlatformTypesRequest): GetAllPlatformTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllPlatformTypesWithOptions(request, runtime);
}

model GetAllRegionsRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetAllRegionsResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      code?: string(name='Code'),
      name?: string(name='Name'),
    }
  ](name='UsageData')
  }(name='DataList'),
  requestId?: string(name='RequestId'),
}

model GetAllRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAllRegionsResponseBody(name='body'),
}

async function getAllRegionsWithOptions(request: GetAllRegionsRequest, runtime: Util.RuntimeOptions): GetAllRegionsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAllRegions',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAllRegions(request: GetAllRegionsRequest): GetAllRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllRegionsWithOptions(request, runtime);
}

model GetBalanceBandwidthDataRequest {
  dataInterval?: int32(name='DataInterval'),
  resourceId?: string(name='ResourceId'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetBalanceBandwidthDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetBalanceBandwidthDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetBalanceBandwidthDataResponseBody(name='body'),
}

async function getBalanceBandwidthDataWithOptions(request: GetBalanceBandwidthDataRequest, runtime: Util.RuntimeOptions): GetBalanceBandwidthDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBalanceBandwidthData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBalanceBandwidthData(request: GetBalanceBandwidthDataRequest): GetBalanceBandwidthDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBalanceBandwidthDataWithOptions(request, runtime);
}

model GetBalanceTrafficDataRequest {
  dataInterval?: int32(name='DataInterval'),
  resourceId?: string(name='ResourceId'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetBalanceTrafficDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetBalanceTrafficDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetBalanceTrafficDataResponseBody(name='body'),
}

async function getBalanceTrafficDataWithOptions(request: GetBalanceTrafficDataRequest, runtime: Util.RuntimeOptions): GetBalanceTrafficDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBalanceTrafficData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBalanceTrafficData(request: GetBalanceTrafficDataRequest): GetBalanceTrafficDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBalanceTrafficDataWithOptions(request, runtime);
}

model GetBandwidthDataRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetBandwidthDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetBandwidthDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetBandwidthDataResponseBody(name='body'),
}

async function getBandwidthDataWithOptions(request: GetBandwidthDataRequest, runtime: Util.RuntimeOptions): GetBandwidthDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBandwidthData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBandwidthData(request: GetBandwidthDataRequest): GetBandwidthDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBandwidthDataWithOptions(request, runtime);
}

model GetClientsRatioRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetClientsRatioResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      name?: string(name='Name'),
      rate?: string(name='Rate'),
      value?: string(name='Value'),
    }
  ](name='UsageData')
  }(name='DataList'),
  requestId?: string(name='RequestId'),
}

model GetClientsRatioResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClientsRatioResponseBody(name='body'),
}

async function getClientsRatioWithOptions(request: GetClientsRatioRequest, runtime: Util.RuntimeOptions): GetClientsRatioResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetClientsRatio',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClientsRatio(request: GetClientsRatioRequest): GetClientsRatioResponse {
  var runtime = new Util.RuntimeOptions{};
  return getClientsRatioWithOptions(request, runtime);
}

model GetConsumerStatusRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetConsumerStatusResponseBody = {
  audit?: int32(name='Audit'),
  businessType?: string(name='BusinessType'),
  cdnUrlRedirectFlag?: boolean(name='CdnUrlRedirectFlag'),
  code?: int32(name='Code'),
  comment?: string(name='Comment'),
  createdAt?: string(name='CreatedAt'),
  inservice?: boolean(name='Inservice'),
  integreatedMode?: int32(name='IntegreatedMode'),
  liveMonitor?: boolean(name='LiveMonitor'),
  realtimeMonitor?: boolean(name='RealtimeMonitor'),
  requestId?: string(name='RequestId'),
  updatedAt?: string(name='UpdatedAt'),
}

model GetConsumerStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetConsumerStatusResponseBody(name='body'),
}

async function getConsumerStatusWithOptions(request: GetConsumerStatusRequest, runtime: Util.RuntimeOptions): GetConsumerStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConsumerStatus',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getConsumerStatus(request: GetConsumerStatusRequest): GetConsumerStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConsumerStatusWithOptions(request, runtime);
}

model GetControlRulesRequest {
  page?: string(name='Page'),
  pageSize?: string(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetControlRulesResponseBody = {
  code?: int32(name='Code'),
  pager?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='Pager'),
  requestId?: string(name='RequestId'),
  settingList?: {
    setting?: [ 
    {
      appVersion?: string(name='AppVersion'),
      businessType?: string(name='BusinessType'),
      clientId?: string(name='ClientId'),
      createdAt?: string(name='CreatedAt'),
      ispName?: string(name='IspName'),
      marketType?: string(name='MarketType'),
      name?: string(name='Name'),
      onoff?: boolean(name='Onoff'),
      platformType?: string(name='PlatformType'),
      region?: string(name='Region'),
      resourceId?: string(name='ResourceId'),
      updatedAt?: string(name='UpdatedAt'),
      usable?: boolean(name='Usable'),
    }
  ](name='Setting')
  }(name='SettingList'),
}

model GetControlRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetControlRulesResponseBody(name='body'),
}

async function getControlRulesWithOptions(request: GetControlRulesRequest, runtime: Util.RuntimeOptions): GetControlRulesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetControlRules',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getControlRules(request: GetControlRulesRequest): GetControlRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getControlRulesWithOptions(request, runtime);
}

model GetCoverRateDataRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetCoverRateDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetCoverRateDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCoverRateDataResponseBody(name='body'),
}

async function getCoverRateDataWithOptions(request: GetCoverRateDataRequest, runtime: Util.RuntimeOptions): GetCoverRateDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCoverRateData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCoverRateData(request: GetCoverRateDataRequest): GetCoverRateDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCoverRateDataWithOptions(request, runtime);
}

model GetCurrentModeRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetCurrentModeResponseBody = {
  code?: int32(name='Code'),
  effectiveAt?: int32(name='EffectiveAt'),
  estimateBandwidth?: int32(name='EstimateBandwidth'),
  modeCode?: int32(name='ModeCode'),
  paddingModeCode?: int32(name='PaddingModeCode'),
  requestId?: string(name='RequestId'),
}

model GetCurrentModeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCurrentModeResponseBody(name='body'),
}

async function getCurrentModeWithOptions(request: GetCurrentModeRequest, runtime: Util.RuntimeOptions): GetCurrentModeResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCurrentMode',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCurrentMode(request: GetCurrentModeRequest): GetCurrentModeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCurrentModeWithOptions(request, runtime);
}

model GetDomainCountRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetDomainCountResponseBody = {
  code?: int32(name='Code'),
  data?: int32(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetDomainCountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDomainCountResponseBody(name='body'),
}

async function getDomainCountWithOptions(request: GetDomainCountRequest, runtime: Util.RuntimeOptions): GetDomainCountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDomainCount',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDomainCount(request: GetDomainCountRequest): GetDomainCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDomainCountWithOptions(request, runtime);
}

model GetDomainsRequest {
  domain?: string(name='Domain'),
  page?: string(name='Page'),
  pageSize?: string(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetDomainsResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      businessType?: string(name='BusinessType'),
      createdAt?: string(name='CreatedAt'),
      domain?: string(name='Domain'),
      resourceId?: string(name='ResourceId'),
      sliceFormat?: string(name='SliceFormat'),
      status?: boolean(name='Status'),
      updatedAt?: string(name='UpdatedAt'),
    }
  ](name='UsageData')
  }(name='DataList'),
  pager?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='Pager'),
  requestId?: string(name='RequestId'),
}

model GetDomainsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDomainsResponseBody(name='body'),
}

async function getDomainsWithOptions(request: GetDomainsRequest, runtime: Util.RuntimeOptions): GetDomainsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDomains',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDomains(request: GetDomainsRequest): GetDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDomainsWithOptions(request, runtime);
}

model GetExpenseSummaryRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetExpenseSummaryResponseBody = {
  code?: int32(name='Code'),
  data?: {
    coverRate?: float(name='CoverRate'),
    forecastFluency?: float(name='ForecastFluency'),
    shareRate?: float(name='ShareRate'),
    topBandwidth?: long(name='TopBandwidth'),
    totalTraffic?: long(name='TotalTraffic'),
    totalUV?: int32(name='TotalUV'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetExpenseSummaryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetExpenseSummaryResponseBody(name='body'),
}

async function getExpenseSummaryWithOptions(request: GetExpenseSummaryRequest, runtime: Util.RuntimeOptions): GetExpenseSummaryResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExpenseSummary',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getExpenseSummary(request: GetExpenseSummaryRequest): GetExpenseSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getExpenseSummaryWithOptions(request, runtime);
}

model GetFeeHistoryRequest {
  page?: string(name='Page'),
  pageSize?: string(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetFeeHistoryResponseBody = {
  code?: int32(name='Code'),
  feeList?: {
    fee?: [ 
    {
      businessType?: string(name='BusinessType'),
      date?: string(name='Date'),
      endDate?: string(name='EndDate'),
      flowOut?: int32(name='FlowOut'),
      levelThreeBandwidth?: int32(name='LevelThreeBandwidth'),
      levelThreeTraffic?: int32(name='LevelThreeTraffic'),
      levelTwoBandwidth?: int32(name='LevelTwoBandwidth'),
      levelTwoTraffic?: int32(name='LevelTwoTraffic'),
      mode?: string(name='Mode'),
      resourceId?: string(name='ResourceId'),
      startDate?: string(name='StartDate'),
      timeSpan?: string(name='TimeSpan'),
      totalBandwidth?: int32(name='TotalBandwidth'),
      totalTraffic?: int32(name='TotalTraffic'),
    }
  ](name='Fee')
  }(name='FeeList'),
  pager?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='Pager'),
  requestId?: string(name='RequestId'),
}

model GetFeeHistoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFeeHistoryResponseBody(name='body'),
}

async function getFeeHistoryWithOptions(request: GetFeeHistoryRequest, runtime: Util.RuntimeOptions): GetFeeHistoryResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFeeHistory',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFeeHistory(request: GetFeeHistoryRequest): GetFeeHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFeeHistoryWithOptions(request, runtime);
}

model GetFirstFrameDelayDataRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetFirstFrameDelayDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetFirstFrameDelayDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFirstFrameDelayDataResponseBody(name='body'),
}

async function getFirstFrameDelayDataWithOptions(request: GetFirstFrameDelayDataRequest, runtime: Util.RuntimeOptions): GetFirstFrameDelayDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFirstFrameDelayData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFirstFrameDelayData(request: GetFirstFrameDelayDataRequest): GetFirstFrameDelayDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFirstFrameDelayDataWithOptions(request, runtime);
}

model GetFluencyDataRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetFluencyDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetFluencyDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFluencyDataResponseBody(name='body'),
}

async function getFluencyDataWithOptions(request: GetFluencyDataRequest, runtime: Util.RuntimeOptions): GetFluencyDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFluencyData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFluencyData(request: GetFluencyDataRequest): GetFluencyDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFluencyDataWithOptions(request, runtime);
}

model GetLogsListRequest {
  date?: string(name='Date'),
  domain?: string(name='Domain'),
  endTime?: string(name='EndTime'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime'),
  version?: string(name='Version'),
}

model GetLogsListResponseBody = {
  code?: int32(name='Code'),
  logList?: {
    log?: [ 
    {
      endDate?: string(name='EndDate'),
      fileName?: string(name='FileName'),
      startDate?: string(name='StartDate'),
      url?: string(name='Url'),
    }
  ](name='Log')
  }(name='LogList'),
  requestId?: string(name='RequestId'),
}

model GetLogsListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetLogsListResponseBody(name='body'),
}

async function getLogsListWithOptions(request: GetLogsListRequest, runtime: Util.RuntimeOptions): GetLogsListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetLogsList',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getLogsList(request: GetLogsListRequest): GetLogsListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getLogsListWithOptions(request, runtime);
}

model GetShareRateDataRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetShareRateDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetShareRateDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetShareRateDataResponseBody(name='body'),
}

async function getShareRateDataWithOptions(request: GetShareRateDataRequest, runtime: Util.RuntimeOptions): GetShareRateDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetShareRateData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getShareRateData(request: GetShareRateDataRequest): GetShareRateDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getShareRateDataWithOptions(request, runtime);
}

model GetTokenListRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetTokenListResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  tokenList?: {
    token?: [ 
    {
      clientId?: string(name='ClientId'),
      createdAt?: string(name='CreatedAt'),
      platformName?: string(name='PlatformName'),
      platformType?: string(name='PlatformType'),
      resourceId?: string(name='ResourceId'),
      token?: string(name='Token'),
      updatedAt?: string(name='UpdatedAt'),
    }
  ](name='Token')
  }(name='TokenList'),
}

model GetTokenListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTokenListResponseBody(name='body'),
}

async function getTokenListWithOptions(request: GetTokenListRequest, runtime: Util.RuntimeOptions): GetTokenListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTokenList',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTokenList(request: GetTokenListRequest): GetTokenListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTokenListWithOptions(request, runtime);
}

model GetTrafficByRegionRequest {
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model GetTrafficByRegionResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  trafficDataList?: {
    trafficData?: [ 
    {
      name?: string(name='Name'),
      traffic?: long(name='Traffic'),
    }
  ](name='TrafficData')
  }(name='TrafficDataList'),
}

model GetTrafficByRegionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrafficByRegionResponseBody(name='body'),
}

async function getTrafficByRegionWithOptions(request: GetTrafficByRegionRequest, runtime: Util.RuntimeOptions): GetTrafficByRegionResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrafficByRegion',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrafficByRegion(request: GetTrafficByRegionRequest): GetTrafficByRegionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrafficByRegionWithOptions(request, runtime);
}

model GetTrafficDataRequest {
  businessType?: string(name='BusinessType'),
  domain?: string(name='Domain'),
  endDate?: string(name='EndDate'),
  ispName?: string(name='IspName'),
  platformType?: string(name='PlatformType'),
  region?: string(name='Region'),
  securityToken?: string(name='SecurityToken'),
  startDate?: string(name='StartDate'),
  version?: string(name='Version'),
}

model GetTrafficDataResponseBody = {
  code?: int32(name='Code'),
  dataList?: {
    usageData?: [ 
    {
      date?: string(name='Date'),
      values?: {
        values?: [ string ](name='Values')
      }(name='Values'),
    }
  ](name='UsageData')
  }(name='DataList'),
  labels?: {
    label?: [ string ](name='Label')
  }(name='Labels'),
  requestId?: string(name='RequestId'),
}

model GetTrafficDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetTrafficDataResponseBody(name='body'),
}

async function getTrafficDataWithOptions(request: GetTrafficDataRequest, runtime: Util.RuntimeOptions): GetTrafficDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrafficData',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getTrafficData(request: GetTrafficDataRequest): GetTrafficDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrafficDataWithOptions(request, runtime);
}

model StartDomainRequest {
  domain?: string(name='Domain'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model StartDomainResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model StartDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartDomainResponseBody(name='body'),
}

async function startDomainWithOptions(request: StartDomainRequest, runtime: Util.RuntimeOptions): StartDomainResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartDomain',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startDomain(request: StartDomainRequest): StartDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return startDomainWithOptions(request, runtime);
}

model StopDomainRequest {
  domain?: string(name='Domain'),
  securityToken?: string(name='SecurityToken'),
  version?: string(name='Version'),
}

model StopDomainResponseBody = {
  code?: int32(name='Code'),
  requestId?: string(name='RequestId'),
  resourceId?: string(name='ResourceId'),
}

model StopDomainResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StopDomainResponseBody(name='body'),
}

async function stopDomainWithOptions(request: StopDomainRequest, runtime: Util.RuntimeOptions): StopDomainResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopDomain',
    version = '2017-04-11',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopDomain(request: StopDomainRequest): StopDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopDomainWithOptions(request, runtime);
}

